package org.cbg.panel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.tool.tcpimg.UIUtils;
import org.cbg.bean.SearchGoodsBean;
import org.cbg.btn.TrslationMainBtn;
import org.cbg.frame.TrslationMainJframe;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.CutButtonImage;
import org.come.until.GsonUtil;

import com.updateNew.MyIsif;



/**
 * 我要买首页面板
 * 
 * @author Administrator
 * 
 */
public class TraslationWantBuyShouyeJpanel extends JPanel {


    /**
     * 用来保存首页的搜索内容
     */
    public static String sousuoneirong;
    public static Integer sousuoType;
    public static SearchGoodsBean searchGoodsBean;
    public static Integer showOrder;
    /**
     * 下拉框
     */
    private JLabel chooseLeft, chooseRight;

    /**
     * 下拉框箭头
     */
    private TrslationMainBtn chooseLeftArrows, chooseRightArrows;

    /**
     * 下拉框列表
     */
    private TraslationSelectOptionJpanel chooseLeftModel, chooseRightModel;

    /**
     * 判断是否下拉（0下拉，1没下拉）
     */
    private int leftFlag = 1, rightFlag = 1;

    /**
     * 搜索输入框
     */
    private JTextField jTextField;

    /**
     * 搜索按钮
     */
    private TrslationMainBtn button;

    /**
     * 菜单 "全部","大话币","道具","召唤兽","装备","灵宝"
     */
    private JLabel allMenu, dahuabi, daoju, zhaohuanshou, zhaungbei, lingbao1, lingbao;
    /**
     * 判断是否点击对应菜单标识 "全部"=1,"大话币"=2,"道具"=3,"召唤兽"=4,"装备"=5,"灵宝"=6
     */
    private int openType = 1;

    /**
     * 分类搜索面板
     */
    // private TraslationWantBuyShouyeFenyeisousuoJpanel
    // traslationWantBuyShouyeFenyeisousuoJpanel;

    private TraslationWantBuyShouyeModelJpanel traslationWantBuyShouyeModelJpanel;

    public TraslationWantBuyShouyeJpanel() {

        this.setPreferredSize(new Dimension(755, 495));

        this.setOpaque(false);
        this.setLayout(null);




        traslationWantBuyShouyeModelJpanel = new TraslationWantBuyShouyeModelJpanel(7);
        this.add(traslationWantBuyShouyeModelJpanel);

        this.add(getChooseRightArrows(this));
        this.add(getChooseLeftArrows(this));
        /**
         * 左边下拉框设置
         */
        chooseLeft = new JLabel("一千万");
        chooseLeft.setBounds(127 + 160, 126, 100, 20);
        chooseLeft.setForeground(UIUtils.COLOR_cbg2);
        chooseLeft.setOpaque(false);
        chooseLeft.setVisible(false);
        this.add(chooseLeft);
        String[] rowDataLeft = { "一千万","一亿", "二亿", "三亿", "四亿", "十亿", "二十亿", "三十亿", "四十亿", "十亿", "五十亿", "六十亿", "七十亿", "八十亿",
                "九十亿", "一百亿" };
        chooseLeftModel = new TraslationSelectOptionJpanel(100, 155, "inkImg/old/1/Z1000.png", rowDataLeft);
        chooseLeftModel.setBounds(124 + 160, 147, 100, 155);

        this.add(chooseLeftModel);
        chooseLeftModel.setVisible(false);
        chooseLeft.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                if (leftFlag == 1) {
                    chooseLeftModel.setVisible(true);
                    leftFlag = 0;
                } else {
                    chooseLeftModel.setVisible(false);
                    leftFlag = 1;
                }
            }
        });
        chooseLeftModel.getJlist().addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                int count = chooseLeftModel.getJlist().getSelectedIndex();// 获取你选中的行号（记录）
                String getname = chooseLeftModel.getJlist().getSelectedValue();// 读取你获取行号的某一列的值（也就是字段）
                chooseLeft.setText(getname);
                chooseLeftModel.setVisible(false);
                leftFlag = 1;
            }
        });

        /**
         * 右边侧边栏
         */
        chooseRight = new JLabel("一百亿");
        chooseRight.setBounds(265 + 142, 126, 100, 20);
        chooseRight.setForeground(UIUtils.COLOR_cbg2);
        chooseRight.setOpaque(false);
        chooseRight.setVisible(false);
        this.add(chooseRight);
        String[] rowDataRight = { "一亿", "二亿", "三亿", "四亿", "十亿", "二十亿", "三十亿", "四十亿", "十亿", "五十亿", "六十亿", "七十亿", "八十亿",
                "九十亿", "一百亿" };
        chooseRightModel = new TraslationSelectOptionJpanel(100, 155, "inkImg/old/1/Z1000.png", rowDataRight);
        chooseRightModel.setBounds(261 + 142, 147, 100, 155);
        this.add(chooseRightModel);
        chooseRightModel.setVisible(false);
        // chooseRight.addMouseListener(new MouseAdapter() {
        // @Override
        // public void mouseClicked(MouseEvent e) {
        // // TODO Auto-generated method stub
        // if (rightFlag == 1) {
        // chooseRightModel.setVisible(true);
        // rightFlag = 0;
        // } else {
        // chooseRightModel.setVisible(false);
        // rightFlag = 1;
        // }
        // }
        // });
        chooseRightModel.getJlist().addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                int count = chooseRightModel.getJlist().getSelectedIndex();// 获取你选中的行号（记录）
                String getname = chooseRightModel.getJlist().getSelectedValue();// 读取你获取行号的某一列的值（也就是字段）
                chooseRight.setText(getname);
                chooseRightModel.setVisible(false);
                rightFlag = 1;
            }
        });

        jTextField = new JTextField();
        jTextField.setBorder(null);
        jTextField.setOpaque(false);
        jTextField.setBounds(165+10, 117, 427, 37);
        jTextField.setForeground(UIUtils.COLOR_cbg5);
        jTextField.setCaretColor(UIUtils.COLOR_cbg5);
        jTextField.setVisible(true);
        jTextField.setFont(new Font("宋体", Font.PLAIN, 14));
        this.add(jTextField);

        button = new TrslationMainBtn("inkImg/number/b4/ssaj.png", 1, 15, "", this);
        button.setBounds(200 + 145, 180, 65, 26);
        button.setVisible(true);
        button.setOpaque(false);
        button.setBorder(null);
        this.add(button);

        /**
         * 提示文字监听
         */
        class JTextFieldHintListener implements FocusListener {
            private String mHintText;
            private JTextField mTextField;

            public JTextFieldHintListener(String hintText, JTextField textField) {
                this.mHintText = hintText;
                this.mTextField = textField;

            }

            @Override
            public void focusGained(FocusEvent e) {
                String temp = mTextField.getText();
                if (temp.equals(mHintText)) {
                    mTextField.setText("");
                    mTextField.setForeground(UIUtils.COLOR_cbg2);
                }
            }

            @Override
            public void focusLost(FocusEvent e) {
                String temp = mTextField.getText();
                if ("".equals(temp)) {
                    mTextField.setForeground(UIUtils.COLOR_cbg2);
                    mTextField.setText(mHintText);
                }
            }
        }
        jTextField.addFocusListener(new JTextFieldHintListener("关键字或者ID", jTextField));

        allMenu = new JLabel("全部");
        allMenu.setBounds(180, 90, 34, 20);
        allMenu.setBackground(UIUtils.COLOR_cbg9);
        allMenu.setOpaque(true);
        allMenu.setForeground(UIUtils.COLOR_cbg1);
        // allMenu.setBorder(null);
        allMenu.setFont(new Font("宋体", Font.PLAIN, 17));
        this.add(allMenu);

        dahuabi = new JLabel("大话币");
        dahuabi.setBounds(180+34+32, 90, 51, 20);
        dahuabi.setForeground(UIUtils.COLOR_cbg1);
        dahuabi.setFont(new Font("宋体", Font.PLAIN, 17));
        this.add(dahuabi);

        daoju = new JLabel("道具");
        daoju.setBounds(180+51+32+31+34, 90, 34, 20);
        daoju.setForeground(UIUtils.COLOR_cbg1);
        daoju.setFont(new Font("宋体", Font.PLAIN, 17));
        this.add(daoju);

        zhaohuanshou = new JLabel("召唤兽");
        zhaohuanshou.setBounds(180+51+32+31+34+34+32, 90, 51, 20);
        zhaohuanshou.setForeground(UIUtils.COLOR_cbg1);
        zhaohuanshou.setFont(new Font("宋体", Font.PLAIN, 17));
        this.add(zhaohuanshou);

        zhaungbei = new JLabel("装备");
        zhaungbei.setBounds(180+51+32+31+34+34+32+51+31, 90, 34, 20);
        zhaungbei.setForeground(UIUtils.COLOR_cbg1);
        zhaungbei.setFont(new Font("宋体", Font.PLAIN, 17));
        this.add(zhaungbei);

        lingbao = new JLabel("灵宝");
        lingbao.setBounds(596-15-34, 90, 34, 20);
        lingbao.setForeground(UIUtils.COLOR_cbg1);
        lingbao.setFont(new Font("宋体", Font.PLAIN, 17));
        this.add(lingbao);

        lingbao1 = new JLabel("最新上架");
        lingbao1.setBounds(80, 268, 100, 50);
        lingbao1.setForeground(UIUtils.COLOR_cbg3);
        lingbao1.setFont(UIUtils.TEXT_HY16);
        this.add(lingbao1);

        allMenu.addMouseListener(new MouseListener() {
            @Override
            public void mouseReleased(MouseEvent e) {
                // TODO Auto-generated method stub
            }

            @Override
            public void mousePressed(MouseEvent e) {
                // TODO Auto-generated method stub

            }

            @Override
            public void mouseExited(MouseEvent e) {
                // TODO Auto-generated method stub
                // allMenu.setBackground(null);
                // allMenu.setForeground(Color.white);
                if (openType != 1) {
                    allMenu.setBackground(null);
                    allMenu.setOpaque(false);
                }
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                // TODO Auto-generated method stub
                // //system.out.println("进入了这里");
                // allMenu.setBackground(Color.cyan);
                // allMenu.setForeground(Color.red);
                allMenu.setBackground(UIUtils.COLOR_cbg9);
                allMenu.setOpaque(true);
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub

                /**
                 * 展示不同页面 "全部"=1,"大话币"=2,"道具"=3,"召唤兽"=4,"装备"=5,"灵宝"=6
                 */
                setJLabelNull(openType);
                openType = 1;
                setOpenPanelGray(openType);
                jTextField.setText("");

                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "quanbu");
            }
        });

        dahuabi.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseExited(MouseEvent e) {
                // TODO Auto-generated method stub
                // dahuabi.setForeground(Color.white);

                if (openType != 2) {
                    dahuabi.setBackground(null);
                    dahuabi.setOpaque(false);

                }
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                // TODO Auto-generated method stub
                // dahuabi.setForeground(Color.red);
                dahuabi.setBackground(UIUtils.COLOR_cbg9);
                dahuabi.setOpaque(true);
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                /**
                 * 展示不同页面 "全部"=1,"大话币"=2,"道具"=3,"召唤兽"=4,"装备"=5,"灵宝"=6
                 */
                setJLabelNull(openType);
                openType = 2;
                setOpenPanelGray(openType);
                jTextField.setText("");
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "dahuabi");
            }
        });

        daoju.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
                // TODO Auto-generated method stub
                // daoju.setForeground(Color.red);

                daoju.setBackground(UIUtils.COLOR_cbg9);
                daoju.setOpaque(true);
            }

            @Override
            public void mouseExited(MouseEvent e) {
                // TODO Auto-generated method stub
                // daoju.setForeground(Color.white);
                if (openType != 3) {
                    daoju.setBackground(null);
                    daoju.setOpaque(false);
                }
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                /**
                 * 展示不同页面 "全部"=1,"大话币"=2,"道具"=3,"召唤兽"=4,"装备"=5,"灵宝"=6
                 */
                setJLabelNull(openType);
                openType = 3;
                setOpenPanelGray(openType);
                jTextField.setText("");
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "daoju");
            }
        });
        zhaohuanshou.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
                // TODO Auto-generated method stub
                // zhaohuanshou.setForeground(Color.red);
                zhaohuanshou.setBackground(UIUtils.COLOR_cbg9);
                zhaohuanshou.setOpaque(true);
            }

            @Override
            public void mouseExited(MouseEvent e) {
                // TODO Auto-generated method stub
                // zhaohuanshou.setForeground(Color.white);
                if (openType != 4) {
                    zhaohuanshou.setBackground(null);
                    zhaohuanshou.setOpaque(false);
                }
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                /**
                 * 展示不同页面 "全部"=1,"大话币"=2,"道具"=3,"召唤兽"=4,"装备"=5,"灵宝"=6
                 */
                setJLabelNull(openType);
                openType = 4;
                setOpenPanelGray(openType);
                jTextField.setText("");
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel,
                // "zhaohuanshou");
            }
        });
        zhaungbei.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
                // TODO Auto-generated method stub
                // zhaungbei.setForeground(Color.red);

                zhaungbei.setBackground(UIUtils.COLOR_cbg9);
                zhaungbei.setOpaque(true);
            }

            @Override
            public void mouseExited(MouseEvent e) {
                // TODO Auto-generated method stub
                // zhaungbei.setForeground(Color.white);
                if (openType != 5) {
                    zhaungbei.setBackground(null);
                    zhaungbei.setOpaque(false);
                }
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                /**
                 * 展示不同页面 "全部"=1,"大话币"=2,"道具"=3,"召唤兽"=4,"装备"=5,"灵宝"=6
                 */
                setJLabelNull(openType);
                openType = 5;
                setOpenPanelGray(openType);
                jTextField.setText("");
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "zhuangbei");
            }
        });
        lingbao.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
                // TODO Auto-generated method stub

                lingbao.setBackground(UIUtils.COLOR_cbg9);
                lingbao.setOpaque(true);
            }

            @Override
            public void mouseExited(MouseEvent e) {
                // TODO Auto-generated method stub
                if (openType != 6) {
                    lingbao.setBackground(null);
                    lingbao.setOpaque(false);
                }
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                // TODO Auto-generated method stub
                /**
                 * 展示不同页面 "全部"=1,"大话币"=2,"道具"=3,"召唤兽"=4,"装备"=5,"灵宝"=6
                 */
                setJLabelNull(openType);
                openType = 6;
                setOpenPanelGray(openType);
                jTextField.setText("");
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "lingbao");
            }
        });

    }

    /**
     * 将汉字转换为对应的数字 { "一亿" },{ "十亿" }, { "二亿" }, { "三亿" }, { "四亿" }, { "五亿" }, {
     * "六亿" }, { "七亿" }, { "八亿" }, { "九亿" }, { "一百亿" }
     *
     * @param mathChina
     * @return
     */

    public static BigDecimal changeMath(String mathChina) {
        BigDecimal math = null;

        switch (mathChina) {
            case "一千万":
                math = new BigDecimal("10000000");
                break;
            case "一亿":
                math = new BigDecimal("100000000");
                break;
            case "十亿":
                math = new BigDecimal("1000000000");
                break;
            case "二十亿":
                math = new BigDecimal("2000000000");
                break;
            case "三十亿":
                math = new BigDecimal("3000000000");
                break;
            case "四十亿":
                math = new BigDecimal("4000000000");
                break;
            case "五十亿":
                math = new BigDecimal("5000000000");
                break;
            case "六十亿":
                math = new BigDecimal("6000000000");
                break;
            case "七十亿":
                math = new BigDecimal("7000000000");
                break;
            case "八十亿":
                math = new BigDecimal("8000000000");
                break;
            case "九十亿":
                math = new BigDecimal("9000000000");
                break;
            case "一百亿":
                math = new BigDecimal("10000000000");
                break;
        }
        return math;
    }

    /**
     * 发送信息搜索数据
     *
     * @param dangqianyeshu
     *            当前页数
//     * @param sousuoType
     *            搜索类型
//     * @param sousuoneirong
     *            搜索内容
     */
    public static void souyeSousuo(Integer dangqianyeshu, Integer showGongshiqi, Integer showOrder,
                                   SearchGoodsBean searchGoodsBean) {


        /**
         * 将搜索信息传给服务器 (更改展示页面的编号) 1、初始化协议
         * 2、修改搜索类型(1为首页搜索,2为大话币搜索,3道具,4召唤兽,5装备,6灵宝,7公示期,8收藏)
         * 3、条件类型(1为首页搜索,2为大话币搜索,3道具,4召唤兽,5装备,6灵宝,7公示期,8收藏) 4、搜索条件的整合
         * 5、转换为json字符串 6、上传给服务器
         */
        TrslationMainJframe.getTrslationMainJframe().setPanelOpen(1);
        // SearchGoodsBean searchGoodsBean = new SearchGoodsBean();
        // searchGoodsBean.setSaletype(sousuoType);
        // // searchGoodsBean.setContiontype(sousuoneirong);
        // searchGoodsBean.setSalename(sousuoneirong);
        searchGoodsBean.setPageNum(dangqianyeshu);
        searchGoodsBean.setShow(showGongshiqi);
        searchGoodsBean.setOrder(showOrder);
        String sendmes = Agreement.getAgreement().searchGoodsAgreement(
                GsonUtil.getGsonUtil().getgson().toJson(searchGoodsBean));
        SendMessageUntil.toServer(sendmes);
    }

//    private ImageIcon icon1;
    private ImageIcon icon2;
    private ImageIcon icon3;
    private ImageIcon icon4;
    private ImageIcon icon5;
    private ImageIcon icon6;
    private ImageIcon icon7;
    private ImageIcon icon8;
    private ImageIcon icon9;

    @Override
    protected void paintComponent(Graphics g) {


        // TODO Auto-generated method stub
        super.paintComponent(g);

        if (icon2 == null) {
            icon2 = CutButtonImage.getImage("inkImg/number/b4/syzxspk.png", 68, 68);

        }
        g.drawImage(icon2.getImage(), 80, 307, 68, 68, this);
        if (icon3 == null) {
            icon3 = CutButtonImage.getImage("inkImg/number/b4/syzxspk.png", 68, 68);

        }
        g.drawImage(icon3.getImage(), 80+68+20, 307, 68, 68, this);
        if (icon4 == null) {
            icon4 = CutButtonImage.getImage("inkImg/number/b4/syzxspk.png", 68, 68);

        }
        g.drawImage(icon4.getImage(), 80+(68+20)*2, 307, 68, 68, this);
        if (icon5 == null) {
            icon5 = CutButtonImage.getImage("inkImg/number/b4/syzxspk.png", 68, 68);

        }
        g.drawImage(icon5.getImage(), 80+(68+20)*3, 307, 68, 68, this);
        if (icon6 == null) {
            icon6 = CutButtonImage.getImage("inkImg/number/b4/syzxspk.png", 68, 68);

        }
        g.drawImage(icon6.getImage(), 80+(68+20)*4, 307, 68, 68, this);
        if (icon7 == null) {
            icon7 = CutButtonImage.getImage("inkImg/number/b4/syzxspk.png", 68, 68);

        }
        g.drawImage(icon7.getImage(), 80+(68+20)*5, 307, 68, 68, this);
        if (icon8 == null) {
            icon8 = CutButtonImage.getImage("inkImg/number/b4/syzxspk.png", 68, 68);

        }
        g.drawImage(icon8.getImage(), 80+(68+20)*6, 307, 68, 68, this);

        if (openType != 2) {
            if(icon9 == null){
            icon9 = CutButtonImage.getImage("inkImg/number/b4/syssk.png", 427, 37);
            }

            g.drawImage(icon9.getImage(), 165, 118, 427, 37, this);
        } else {
            if(icon9 == null){
            icon9 = CutButtonImage.getImage("inkImg/number/b4/dhbssl.png", 427, 37);
            }

            g.drawImage(icon9.getImage(), 165, 118, 427, 37, this);
        }




    }

    /**
     * 根据点击对应的搜索条件展示对应的面板
     *
     * @param openType
     */
    public void setOpenPanelGray(int openType) {

        changeViewZhuJian(openType);
        switch (openType) {
            case 1:
                allMenu.setBackground(UIUtils.COLOR_cbg9);
                allMenu.setOpaque(true);

                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "quanbu");

                break;
            case 2:
                dahuabi.setBackground(UIUtils.COLOR_cbg9);
                dahuabi.setOpaque(true);
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "dahuabi");
                break;
            case 3:
                daoju.setBackground(UIUtils.COLOR_cbg9);
                daoju.setOpaque(true);
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "daoju");
                break;
            case 4:
                zhaohuanshou.setBackground(UIUtils.COLOR_cbg9);
                zhaohuanshou.setOpaque(true);
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "zhaohuanshou");
                break;
            case 5:
                zhaungbei.setBackground(UIUtils.COLOR_cbg9);
                zhaungbei.setOpaque(true);
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "zhuangbei");
                break;
            case 6:
                lingbao.setBackground(UIUtils.COLOR_cbg9);
                lingbao.setOpaque(true);
                // traslationWantBuyShouyeFenyeisousuoJpanel.getCardLayout().show(
                // traslationWantBuyShouyeFenyeisousuoJpanel, "lingbao");
                break;

            default:
                break;
        }
    }

    public void changeViewZhuJian(int type) {
        if (type != 2) {
            this.getChooseLeft().setVisible(false);
            this.getChooseLeftModel().setVisible(false);
            this.getChooseLeftArrows().setVisible(false);
            this.getChooseRight().setVisible(false);
            this.getChooseRightModel().setVisible(false);
            this.getChooseRightArrows().setVisible(false);
            this.getjTextField().setVisible(true);
        } else {
            this.getChooseLeft().setVisible(true);
            this.getChooseLeftArrows().setVisible(true);
            this.getChooseRight().setVisible(true);
            this.getChooseRightArrows().setVisible(true);
            // quanbuJpanel.getChooseRightModel().setVisible(true);
            this.getjTextField().setVisible(false);

        }
    }

    /**
     * 根据点击对应的搜索条件展示对应的面板
     *
     * @param openType
     */
    public void setJLabelNull(int openType) {
        switch (openType) {
            case 1:
                allMenu.setBackground(null);
                allMenu.setOpaque(false);
                break;
            case 2:
                dahuabi.setBackground(null);
                dahuabi.setOpaque(false);
                break;
            case 3:
                daoju.setBackground(null);
                daoju.setOpaque(false);
                break;
            case 4:
                zhaohuanshou.setBackground(null);
                zhaohuanshou.setOpaque(false);
                break;
            case 5:
                zhaungbei.setBackground(null);
                zhaungbei.setOpaque(false);
                break;
            case 6:
                lingbao.setBackground(null);
                lingbao.setOpaque(false);
                break;

            default:
                break;
        }
    }

    public JLabel getAllMenu() {
        return allMenu;
    }

    public void setAllMenu(JLabel allMenu) {
        this.allMenu = allMenu;
    }

    public JLabel getDahuabi() {
        return dahuabi;
    }

    public void setDahuabi(JLabel dahuabi) {
        this.dahuabi = dahuabi;
    }

    public JLabel getDaoju() {
        return daoju;
    }

    public void setDaoju(JLabel daoju) {
        this.daoju = daoju;
    }

    public JLabel getZhaohuanshou() {
        return zhaohuanshou;
    }

    public void setZhaohuanshou(JLabel zhaohuanshou) {
        this.zhaohuanshou = zhaohuanshou;
    }

    public JLabel getZhaungbei() {
        return zhaungbei;
    }

    public void setZhaungbei(JLabel zhaungbei) {
        this.zhaungbei = zhaungbei;
    }

    public JLabel getLingbao() {
        return lingbao;
    }

    public void setLingbao(JLabel lingbao) {
        this.lingbao = lingbao;
    }

    public int getOpenType() {
        return openType;
    }

    public void setOpenType(int openType) {
        this.openType = openType;
    }

    public TraslationWantBuyShouyeModelJpanel getTraslationWantBuyShouyeModelJpanel() {
        return traslationWantBuyShouyeModelJpanel;
    }

    public void setTraslationWantBuyShouyeModelJpanel(
            TraslationWantBuyShouyeModelJpanel traslationWantBuyShouyeModelJpanel) {
        this.traslationWantBuyShouyeModelJpanel = traslationWantBuyShouyeModelJpanel;
    }

    public TrslationMainBtn getChooseLeftArrows(
            TraslationWantBuyShouyeJpanel... traslationWantBuyShouyeFenyeisousuoQuanbuJpanel) {
        if (chooseLeftArrows == null) {
            chooseLeftArrows = new TrslationMainBtn("inkImg/number/b4/xlaj.png", 1, 13, "",
                    traslationWantBuyShouyeFenyeisousuoQuanbuJpanel[0]);
            chooseLeftArrows.setBounds(224 + 145, 131, 13, 13);
            chooseLeftArrows.setVisible(false);
        }
        return chooseLeftArrows;
    }

    public void setChooseLeftArrows(TrslationMainBtn chooseLeftArrows) {
        this.chooseLeftArrows = chooseLeftArrows;
    }

    public TrslationMainBtn getChooseRightArrows(
            TraslationWantBuyShouyeJpanel... traslationWantBuyShouyeFenyeisousuoQuanbuJpanel) {
        if (chooseRightArrows == null) {
            chooseRightArrows = new TrslationMainBtn("inkImg/number/b4/xlaj.png", 1, 14, "",
                    traslationWantBuyShouyeFenyeisousuoQuanbuJpanel[0]);
            chooseRightArrows.setBounds(342 + 145, 131, 13, 13);
            chooseRightArrows.setVisible(false);
        }
        return chooseRightArrows;
    }

    public void setChooseRightArrows(TrslationMainBtn chooseRightArrows) {
        this.chooseRightArrows = chooseRightArrows;
    }

    public static String getSousuoneirong() {
        return sousuoneirong;
    }

    public static void setSousuoneirong(String sousuoneirong) {
        TraslationWantBuyShouyeJpanel.sousuoneirong = sousuoneirong;
    }

    public static Integer getSousuoType() {
        return sousuoType;
    }

    public static void setSousuoType(Integer sousuoType) {
        TraslationWantBuyShouyeJpanel.sousuoType = sousuoType;
    }

    public static SearchGoodsBean getSearchGoodsBean() {
        return searchGoodsBean;
    }

    public static void setSearchGoodsBean(SearchGoodsBean searchGoodsBean) {
        TraslationWantBuyShouyeJpanel.searchGoodsBean = searchGoodsBean;
    }

    public static Integer getShowOrder() {
        return showOrder;
    }

    public static void setShowOrder(Integer showOrder) {
        TraslationWantBuyShouyeJpanel.showOrder = showOrder;
    }

    public JLabel getChooseLeft() {
        return chooseLeft;
    }

    public void setChooseLeft(JLabel chooseLeft) {
        this.chooseLeft = chooseLeft;
    }

    public JLabel getChooseRight() {
        return chooseRight;
    }

    public void setChooseRight(JLabel chooseRight) {
        this.chooseRight = chooseRight;
    }

    public TraslationSelectOptionJpanel getChooseLeftModel() {
        return chooseLeftModel;
    }

    public void setChooseLeftModel(TraslationSelectOptionJpanel chooseLeftModel) {
        this.chooseLeftModel = chooseLeftModel;
    }

    public TraslationSelectOptionJpanel getChooseRightModel() {
        return chooseRightModel;
    }

    public void setChooseRightModel(TraslationSelectOptionJpanel chooseRightModel) {
        this.chooseRightModel = chooseRightModel;
    }

    public int getLeftFlag() {
        return leftFlag;
    }

    public void setLeftFlag(int leftFlag) {
        this.leftFlag = leftFlag;
    }

    public int getRightFlag() {
        return rightFlag;
    }

    public void setRightFlag(int rightFlag) {
        this.rightFlag = rightFlag;
    }

    public JTextField getjTextField() {
        return jTextField;
    }

    public void setjTextField(JTextField jTextField) {
        this.jTextField = jTextField;
    }

//    public ImageIcon getIcon1() {
//        return icon1;
//    }
//
//    public void setIcon1(ImageIcon icon1) {
//        this.icon1 = icon1;
//    }

    public ImageIcon getIcon2() {
        return icon2;
    }

    public void setIcon2(ImageIcon icon2) {
        this.icon2 = icon2;
    }

    public ImageIcon getIcon3() {
        return icon3;
    }

    public void setIcon3(ImageIcon icon3) {
        this.icon3 = icon3;
    }

    public ImageIcon getIcon4() {
        return icon4;
    }

    public void setIcon4(ImageIcon icon4) {
        this.icon4 = icon4;
    }

    public ImageIcon getIcon5() {
        return icon5;
    }

    public void setIcon5(ImageIcon icon5) {
        this.icon5 = icon5;
    }

    public ImageIcon getIcon6() {
        return icon6;
    }

    public void setIcon6(ImageIcon icon6) {
        this.icon6 = icon6;
    }

    public ImageIcon getIcon7() {
        return icon7;
    }

    public void setIcon7(ImageIcon icon7) {
        this.icon7 = icon7;
    }

    public ImageIcon getIcon8() {
        return icon8;
    }

    public void setIcon8(ImageIcon icon8) {
        this.icon8 = icon8;
    }

    public TrslationMainBtn getChooseLeftArrows() {
        return chooseLeftArrows;
    }

    public TrslationMainBtn getChooseRightArrows() {
        return chooseRightArrows;
    }

}
